#pragma once;

#include "windowimpl.hpp"
#include <windows.h>

namespace dexgel
{
	namespace priv
	{
		class RendererDx; // fwd decl

		class WindowImplDX : public WindowImpl
		{
		public:
			WindowImplDX();
			WindowImplDX(int xres, int yres, const std::string& Title );
			~WindowImplDX();

			void UpdateMessages();
			bool IsOpened();
			Rendrer* getRendrer();
			virtual double getTime();
		private:
			static LRESULT CALLBACK GlobalOnEvent(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam);
			void ProcessEvent(UINT Message, WPARAM WParam, LPARAM LParam);

			void initTimer();

			// Static members
			static const char*      ourClassNameA;
			static WindowImplDX*	self_instance;

			// Members
			RendererDx *g3D;
			
			std::string myTitle;
			bool isOpened;

			long          myCallback;         ///< Stores the original event callback function of the control
			HWND          myHandle;

			// Timer
			double hasPerformanceCounter;
			double timerResolution;
			__int64 t0_64;
			unsigned int t0_32;

		};
	}
}